\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\title{Dr.John Burns}
\author {Umar Riaz - x00097977}
\date{\today}
\maketitle
Continous Assessment 2
\section{Question-1}
\begin{enumerate}
\item Please see the attached file and compile this file using gcc -g Example.c -lpthread -std=c99 -O

\item Parallel Execution:
\par
  As we need to find minimum, maximum and mean of the randomly generated array of integers in between 0 and 1000, so all of them can be tranformed into a single and independent thread. Here we find two cases, in our first case if we make a thread for randomly assigning the integers to an array then we need to use a mechanism where that array should be locked and prior to assigning the randomly generated integers no other thread should be able to access that array. Along with that we can create first thread that should calculate minimum vale in the array, second thread should find the maximum value in the array and the last thread that should calculate the mean of the array. In the second case we can assign randomly generated integers between 0-1000 and after that we can create three threads to find out the minimum,maximum and mean value of the array . All these three required values are not dependent so we can so all three threads that will be created  will execute and compute in parallel and they will be doing independent calculations.
\item  Please see the attached file and Execute this file using  gcc Example.c -std=c99  -g -O

\end{enumerate}

\end{document}
